<?php

namespace app\api\controller;

use ba\Date;
use Throwable;
use ba\Captcha;
use ba\Random;
use app\common\model\User;
use think\facade\Validate;
use app\common\facade\Token;
use app\common\model\UserScoreLog;
use app\common\model\UserMoneyLog;
use app\common\controller\Frontend;
use app\api\validate\Account as AccountValidate;

class Banner extends Frontend
{
    protected array $noNeedLogin = ['lists'];


    public function initialize(): void
    {
        parent::initialize();
    }

    public function lists(): void
    {
        $params = $this->request->param();
        $res = \app\admin\model\Banner::where('status',1)->order('weigh asc')->paginate($params['limit'] ?? 99);

        foreach ($res->items() as &$item) {
            $item->cover = full_url($item->cover);
        }

        $this->success('',['lists' => $res->items(),'total' => $res->total()]);
    }


}
